package com.huabo.contract.oracle.mapper;

import com.hbfk.util.PageInfo;
import com.huabo.contract.oracle.entity.TblLegalProceedingsrecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huabo
 * @since 2022-03-21
 */
public interface TblLegalProceedingsrecordMapper extends BaseMapper<TblLegalProceedingsrecord> {

    @InsertProvider(type = TblLegalProceedingsrecordMapperSqlConfig.class,method = "saveProceedingRecord")
    @Options(useGeneratedKeys=true, keyProperty="proceedid", keyColumn="PROCEEDID")
    void saveProceedingRecord(TblLegalProceedingsrecord proceed);

    @Select("SELECT * FROM TBL_LEGAL_PROCEEDINGSRECORD WHERE LITIGATIONINFO = #{litigationid}")
    List<TblLegalProceedingsrecord> findListByLitigationid(Integer litigationid);

    @Select("SELECT * FROM TBL_LEGAL_PROCEEDINGSRECORD WHERE PROCEEDID = #{proceedid}")
    TblLegalProceedingsrecord findByProceedid(Integer proceedid);

    @UpdateProvider(type = TblLegalProceedingsrecordMapperSqlConfig.class,method = "updateModifyNegotiateRecord")
    void updateModifyNegotiateRecord(TblLegalProceedingsrecord oldproceed);

    @Delete("DELETE FROM TBL_LEGAL_PROCEEDINGSRECORD WHERE PROCEEDID = #{proceedid}")
    void deleteProceedid(Integer proceedId);

    @SelectProvider(type = TblLegalProceedingsrecordMapperSqlConfig.class,method = "findListByPageInfo")
    List<TblLegalProceedingsrecord> findListByPageInfo(PageInfo<TblLegalProceedingsrecord> pageInfo, TblLegalProceedingsrecord record);

    @SelectProvider(type = TblLegalProceedingsrecordMapperSqlConfig.class,method = "findListByPageInfoCount")
    Integer findListByPageInfoCount(TblLegalProceedingsrecord record);

    @SelectProvider(type = TblLegalProceedingsrecordMapperSqlConfig.class,method = "findByNegotiaId")
    List<TblLegalProceedingsrecord> findByNegotiaId(PageInfo<TblLegalProceedingsrecord> pageInfo, Integer litigationId);

    @SelectProvider(type = TblLegalProceedingsrecordMapperSqlConfig.class,method = "findByNegotiaIdCount")
    Integer findByNegotiaIdCount(Integer litigationId);
}
